﻿@model IEnumerable<Helena.Areas.Reportes.Models.KardexSalida>
@using Helena.Areas.Productos.Models;
@using Telerik.Web.Mvc.UI;
@using Helena.Models;
@{
    ViewBag.Title = "Kardex";
    Layout = "~/Views/Shared/_Layout.cshtml";
    //List<ProductoView> productos = null;
    Fecha f = (Fecha)Session["Fecha"];
    //try
    //{
    //    productos = (List<ProductoView>)Session["Productos"];
    //}
    //catch
    //{
    //    productos = null;
    //}
        
}
        @using (Html.BeginForm())
        {
            <fieldset>
            <legend>Realizar Filtro </legend>
                <table style="width:20%">
                    <tr>
                        <td>
                            <div class="editor-label"><b>Año:</b></div>
                            <div class="editor-field">
                            @(Html.Telerik().ComboBox()
                              .Name("anho")
                              .SelectedIndex(1)
                              .BindTo(new SelectList(f.anho, "ID", "Descripcion"))
                              )
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="editor-label"><b>Mes:</b></div>
                            <div class="editor-field">
                            @(Html.Telerik().ComboBox()
                              .Name("mes")
                              .SelectedIndex(0)
                              .BindTo(new SelectList(f.mes, "ID", "Descripcion"))
                              )
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                                <input type="submit" value="Exportar" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        }

@*@if (Model != null)
{
    foreach (var item in Model)
    {
            <table>
                <tr>
                    <th style="text-align:center; vertical-align:top">@Html.DisplayFor(modelItem => item.Fecha.Day) / @Html.DisplayFor(modelItem => item.Fecha.Month) / @Html.DisplayFor(modelItem => item.Fecha.Year) / @DateTime.Now.ToShortTimeString()</th>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <th>Producto</th>
                                <th>Cantidad Inicial</th>
                                <th>Entradas</th>
                                <th>Salidas</th>
                                <th>Degustaciones</th>
                                <th>Ventas</th>
                                <th>Cantidad Final</th>
                            </tr>
                            @foreach (var k in item.kardex)
                            {
                            <tr>
                                <td>@Html.DisplayFor(modelItem => k.ProducttoDescripcion)</td>
                                <td>@Html.DisplayFor(modelItem => k.CantidadInicial)</td>
                                <td>@Html.DisplayFor(modelItem => k.Entrada)</td>
                                <td>@Html.DisplayFor(modelItem => k.Salida)</td>
                                <td>@Html.DisplayFor(modelItem => k.Degustacion)</td>
                                <td>@Html.DisplayFor(modelItem => k.Venta)</td>
                                <td>@Html.DisplayFor(modelItem => k.CantidadFinal)</td>
                            </tr>                            
                            }
                        </table>
                    </td>
                </tr>
            </table>
    }
}
    </tr>
    <tr>
        <td>
            <table style="width:20%"> 
                <tr> 
                    <td style="background-color: #CCFF99; color: #808080; font-weight: bold; font-size: 20px; border-style: ridge">
                    <@Html.ActionLink("ExportarExcel", "ExportarExcelMensual", "Kardex", null)>
                    </td>
                </tr>
            </table>   
        </td>
    </tr>
</table>*@

 

        
